package io.github.talelin.latticy.bo;

import io.github.talelin.latticy.model.Banner;
import io.github.talelin.latticy.model.BannerItem;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.BeanUtils;

import java.util.List;

/**
 * @author tanrentao
 * @since 2021-08-10
 */
@Data
@NoArgsConstructor
public class BannerWithItemsBO {

    private Integer id;

    private String name;

    private String title;

    private String img;

    private String description;

    List<BannerItem> items;

    public BannerWithItemsBO(Banner banner, List<BannerItem> items) {
        BeanUtils.copyProperties(banner, this);
        this.setItems(items);
    }
}
